﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo1
{
    internal class Program
    {
        /// <summary>
        /// 算术运算符
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            var num1 = 23;
            var num2 = 10;
            var result = 0;

            result = num1 + num2;
            Console.WriteLine("行1-加法运算符{0}+{1}={2}", num1, num2, result);

            result = num1 - num2;
            Console.WriteLine("行2-减法运算符{0}-{1}={2}", num1, num2, result);

            result = num1 * num2;
            Console.WriteLine("行3-乘法运算符{0}×{1}={2}", num1, num2, result);

            result = num1 / num2;
            Console.WriteLine("行4-除法运算符{0}÷{1}={2}", num1, num2, result);

            result = num1 % num2;
            Console.WriteLine("行5-求余运算符{0}%{1}={2}", num1, num2, result);

            // ++ -- 
            // 先进行自增，再运算的，自增自减运算符在前
            result = ++num1;
            Console.WriteLine("行6-自增运算符：++num1，num1的值是{0}，result的值是{1}", num1, result);
            // 先进行运算，再自增的，自增自减运算符在后
            result = num2++;
            Console.WriteLine("行7-自增运算符：num2++，num2的值是{0}，result的值是{1}", num2, result);

            Console.ReadKey();
        }
    }
}
